import config from "@/config";
import { getQueryString } from "../url/getQueryString";
import { ssoLoginType } from "./model";
export const ssoLogin=(type:ssoLoginType,goto?:string)=>{
    try {
        if(type == "personal"){
            window.location.href=`${config.PERSONALSSO_URL}&goto=${goto}`;
        }else{
            window.location.href=`${config.LEGALSSO_URL}?gotoUrl=mobile`;
        }
    } catch (error) {
        throw error;
    }
}





export const setToken=async (tokenName:string)=>{
    console.log(getQueryString("token"))
    getQueryString("token") && localStorage.setItem(tokenName,getQueryString("token") as string);
}